package cn.gov.cbrc.east.verify;

import java.io.File;

public class ResultTotal {
	/** 文件路径 **/
	private String filePath;
	/** 文件行数 **/
	private int row;
	/** 文件校验成功条数 **/
	private int succRows;
	/** 文件校验失败 **/
	private int failRows;
	/** 使用时长 **/
	private int usedTime;
	/** 是否正常结束 **/
	private boolean checked;
	/** 描述信息 **/
	private String message;
	//文件中校验错误字段数
	private int errorFields;
	//文件中校验警告字段数
	private int warningFields;
	
	public ResultTotal(String filePath, boolean checked, String message) {
		super();
		this.filePath = filePath;
		this.checked = checked;
		this.message = message;
	}
	
	public ResultTotal(String filePath, int row, int succRows, int failRows,
			int usedTime, boolean checked, String message, int errorFields,
			int warningFields) {
		super();
		this.filePath = filePath;
		this.row = row;
		this.succRows = succRows;
		this.failRows = failRows;
		this.usedTime = usedTime;
		this.checked = checked;
		this.message = message;
		this.errorFields = errorFields;
		this.warningFields = warningFields;
	}



	public int getRow() {
		return row;
	}
	public void setRow(int row) {
		this.row = row;
	}
	public int getSuccRows() {
		return succRows;
	}
	public void setSuccRows(int succRows) {
		this.succRows = succRows;
	}
	public int getFailRows() {
		return failRows;
	}
	public void setFailRows(int failRows) {
		this.failRows = failRows;
	}
	public int getUsedTime() {
		return usedTime;
	}
	public void setUsedTime(int usedTime) {
		this.usedTime = usedTime;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getFilePath() {
		return filePath;
	}
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public int getErrorFields() {
		return errorFields;
	}

	public void setErrorFields(int errorFields) {
		this.errorFields = errorFields;
	}

	public int getWarningFields() {
		return warningFields;
	}

	public void setWarningFields(int warningFields) {
		this.warningFields = warningFields;
	}

	/**
	 * <p>方法描述: 获取文件名</p>
	 * <p>方法备注: </p>
	 * @return
	 * <p>创建人：王川</p>
	 * <p>创建时间：Jan 14, 2016 11:23:23 AM</p>
	 *
	 */
	public String getFileName() {
		int index = filePath.lastIndexOf(File.separator);
		if (index < 0)
			return filePath;
		return filePath.substring(index + 1);
	}

	@Override
	public String toString() {
		return "ResultTotal [filePath=" + filePath + ", row=" + row
				+ ", succRows=" + succRows + ", failRows=" + failRows
				+ ", usedTime=" + usedTime + ", checked=" + checked
				+ ", message=" + message + ", errorFields=" + errorFields
				+ ", warningFields=" + warningFields + "]";
	}
}
